package com.marketingexpert.dao;



import java.util.List;

import org.springframework.dao.DataAccessException;

import com.marketingexpert.domain.User;
import com.marketingexpert.domain.permission.Role;
import com.marketingexpert.domain.permission.UserRole;

public interface UserDao{

	public int insert(User user) throws DataAccessException;
	
	public User queryUserByUId(String userId) throws DataAccessException;
	
	public List<User> queryUserByParentId(String parentUserId) throws DataAccessException;
	
	/**
	 * ��ҳ��ѯϵͳ�û�
	 * @param cursor
	 * @return
	 * @throws DataAccessException
	 */
	public List<User> queryAllUser(int cursor, int pageSize, String userType) throws DataAccessException;
	
	public void setPermission(String userId,String permission) throws DataAccessException;

	public void deleteUserById(String userId)throws DataAccessException;
	
	public int updateUser(User user) throws DataAccessException;

	public void expiredUserById(String userId,String isactive);
	
	public List<UserRole> queryRoleByUserId(String userId) throws DataAccessException;

	
	public User queryAdmin(String userName);

	/**
	 * �Զ�Ӫ��΢��ʱ��ѯ����parentuSER
	 * @return
	 */
	public List<User> queryAllParentUser();

	
	/**
	 * 获取淘宝用户的总数
	 * @param userType
	 * @return
	 */
	public int queryUserCount(String userType);

	public User queryUserById(int parentUserId);
}
